import cv2

# img = cv2.imread('./data_all/train/images/_MG_0659.jpg')
#
# img = cv2.resize(img, (0,0),fx=0.2,fy=0.2,interpolation=cv2.INTER_NEAREST)
# dh, dw, _ = img.shape
# fl = open('./data_all/train/labels/_MG_0659.txt', 'r')
# data = fl.readlines()
# fl.close()
#
# for dt in data:
#     _, x, y, w, h = map(float, dt.split(' '))
#     l = int((x - w / 2) * dw)
#     r = int((x + w / 2) * dw)
#     t = int((y - h / 2) * dh)
#     b = int((y + h / 2) * dh)
#
#     if l < 0:
#         l = 0
#     if r > dw - 1:
#         r = dw - 1
#     if t < 0:
#         t = 0
#     if b > dh - 1:
#         b = dh - 1
#
#     cv2.rectangle(img, (l, t), (r, b), (0, 0, 255), 1)
#
# cv2.imshow('img', img)
# cv2.waitKey(0)
import os
path = './vocdata/images/'
mod = 'val'
img_dir = os.listdir('./data_all/'+mod+'/images/')
with open('./data_all/'+mod+'/images/'+mod+'.txt', 'w') as f:
    for i in img_dir:
        f.write(path + i+'\n')
f.close()



